#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    bool hasPre = false;
    if (n % 3 == 0) {
        cout << 3;
        hasPre = true;
    }
    if (n % 5 == 0) {
        if (hasPre)
        {
            cout << " ";
        }
        cout << 5;
        hasPre = true;
    }
    if (n % 7 == 0) {
        if (hasPre)
        {
            cout << " ";
        }
        cout << 7;
        hasPre = true;
    }

    if (!hasPre) {
        cout << "n";
    }

    return 0;
}